<template>
  <view class="auth-box"></view>
</template>

<script>
  import qs from '@/utils/qs.js'
  import {platformMap}  from '@/common/models.js'
  import mixin from '@/mixins/auth.js';
  
  // https://localhost:8001/auth/tiktok?code=ayGgauhvnmLNJmJ8-vjBKs0Y7ORDN6Cw2tkuIYf9t_sbatn9sbnuHcCu_Y2ONbXi9TLpkczP2ivodU9nkwFhEMb5qSsEZag_Jfn6pv7suxgmnkWKd53bFgrAa9sRNGgu7wuSDab1ylnOgJmtg5uXEnaNzHm_nMPvcQ5kt4FMYzdVCIpbScIo-uU8IB4JTzmk%2A2%216367.u1&scopes=user.info.basic&state=loginpage
  
  export default {
    mixins: [mixin],
    data() {
      return {
        reURL: '',
        loginState: '',
        loginCode: ''
      }
    },
    onLoad(e) {
      uni.showLoading({
        title: this.$t('login.authing') // todo
      })
      
      this.loginState = e.state
      this.loginCode = e.code
      
      if (this.loginState && this.loginCode) {
        this.login('tiktok', this.loginCode)
      }
    }
  }
</script>

<style>
  .auth-box {
    display: flex;
    align-items: center;
    height: 100vh;
    width: 100vw;
    justify-content: center;
  }
  .button-login {
    width: 654rpx;
    height: 98rpx;
    box-shadow: 0rpx 0rpx 13rpx 0rpx rgba(164, 217, 228, 0.2);
    background-size: contain;
  }
  .button-login-fb {
    background-image: url(../static/img/login/login_fb.png);
  }
</style>